﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class AdvisoryList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GetAdvisory();
        }
    }
    private void GetAdvisory()
    {
        lvAdvisory.DataSource = new GoShopping.BLL.SysInfo.AdvisoryBean().GetAllAdvisory();
        lvAdvisory.DataBind();
    }
    protected void lvAdvisory_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
    {
        ((DataPager)(this.lvAdvisory.FindControl("DataPager1"))).SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
        GetAdvisory();
    }
    protected void lvAdvisory_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        if (ListViewItemType.DataItem == e.Item.ItemType)
        {
            Label lblUserName = e.Item.FindControl("lblUser") as Label;
            if (lblUserName.Text == "")
            {
                lblUserName.Text = "匿名用户";
            }
            Label lblReply = e.Item.FindControl("lblReply") as Label;
            if (lblReply.Text != "")
            {
                lblReply.Text = "回复:" + lblReply.Text;
            }
        }
    }
}
